<div class=" admin-content">

<div class="admin-biaogelist">

    <form class="am-form am-g">
          <table width="100%" class="am-table am-table-bordered am-table-radius am-table-striped am-table-hover">
            <thead>
              <tr class="am-success">
                <th class="table-check"><input type="checkbox" /></th>
                <th class="table-id">ID</th>
                <th class="table-title">相册名字</th>
                <th class="table-type">相册描述</th>
                <th class="table-author am-hide-sm-only">封面</th>
                <th class="table-author am-hide-sm-only">添加图片</th>
                <th width="130px" class="table-set">操作</th>
              </tr>
            </thead>
            <tbody>
              <foreach name="List" item="values">
                <tr>
                  <td><input type="checkbox" /></td>
                  <td>{$values.album_id}</td>
                  <td><a href="{:U('photo/photosSel')}?album_id={$values.album_id}"><b>{$values.album_name}</b></a></td>
                  <td>{$values.album_desc}</td>
                  <td class="am-hide-sm-only"><img src="{$values.album_cover}" alt="" width='10%'></td>
                  <td><a href="{:U('Album/file')}?album_id={$values.album_id}">添加图片</a></td>
                  <td>
                    <div class="am-btn-toolbar">
                      <div class="am-btn-group am-btn-group-xs">
                          <a href="{:U('Album/getOne')}?album_id={$values.album_id}"><span class="am-icon-search" title="查看订单详情" ></span></a>
                          <a href="{:U('Album/update')}?album_id={$values.album_id}"><span class="am-icon-pencil-square-o" ></span></a>
                          <a href="javascript:;" onclick="del(this,{$values.album_id})"><span class="am-icon-trash-o"></span></a>
                      </div>
                    </div>
                  </td>
                </tr>
              </foreach>
            </tbody>
          </table>
            <div class="am-btn-group am-btn-group-xs">
              <button type="button" class="am-btn am-btn-default"><span class="am-icon-plus"></span> 删除</button>
              <button type="button" class="am-btn am-btn-default"><span class="am-icon-plus"></span> 新增</button>
              <button type="button" class="am-btn am-btn-default"><span class="am-icon-trash-o"></span> 删除</button>
            </div>
          <ul class="am-pagination am-fr">
            {$page}
          </ul>
          <hr />
        </form>
        <script>
          function del(t,album_id){
            $.ajax({
              type:"POST",
              url :"{:U('Album/del')}",
              data:{"album_id":album_id},
              success:function(msg){
                if(msg == 1){
                    // t.parent.remove();
                    alert("删除成功");
                    location.href = "";
                }else{
                  alert("删除失败");
                }
              }
            })
          }
        </script>
